<template>
  <a-drawer title="学生个人信息" wrapClassName="fullscreen" height="100%" placement="bottom" :closable="false" @close="handleCancel"
    :visible="previewVisible">
    <a-form style='overflow:auto' class='detailForm'>
      <a-row :gutter="48" style="width:100%">
        <a-col :md="18" :sm="24">
          <a-col :lg="8" :md="12" :sm="24">
            <a-form-item label="考生姓名">
              {{info.ksxm}}
            </a-form-item>
          </a-col>
          <a-col :lg="8" :md="12" :sm="24">
            <a-form-item label="姓名拼音">
              {{info.xmpy}}
            </a-form-item>
          </a-col>
          <a-col :lg="8" :md="12" :sm="24">
            <a-form-item label="性别">
              {{info.xbm}}
            </a-form-item>
          </a-col>
          <a-col :lg="8" :md="12" :sm="24">
            <a-form-item label="出生日期">
              {{info.csrq && info.csrq._i?info.csrq._i:''}}
            </a-form-item>
          </a-col>
          <a-col :lg="8" :md="12" :sm="24">
            <a-form-item label="民族">
              {{info.mzm}}
            </a-form-item>
          </a-col>
          <a-col :lg="8" :md="12" :sm="24">
            <a-form-item label="婚否">
              {{info.hyzkm}}
            </a-form-item>
          </a-col>
          <a-col :lg="8" :md="12" :sm="24">
            <a-form-item label="证件号">
              {{info.zjhm}}
            </a-form-item>
          </a-col>
          <a-col :lg="8" :md="12" :sm="24">
            <a-form-item label="政治面貌">
              {{info.zzmmm}}
            </a-form-item>
          </a-col>
          <a-col :lg="8" :md="12" :sm="24">
            <a-form-item label="考生档案所在单位邮政编码">
              {{info.daszdwyb}}
            </a-form-item>
          </a-col>
          <a-col :lg="8" :md="12" :sm="24">
            <a-form-item label="现学习或工作单位:">
              {{info.xzgzdw}}
            </a-form-item>
          </a-col>
          <a-col :lg="8" :md="12" :sm="24">
            <a-form-item label="学习或工作单位性质">
              {{info.xzgzdwxzm}}
            </a-form-item>
          </a-col>
          <a-col :lg="8" :md="12" :sm="24">
            <a-form-item label="考生来源">
              {{info.kslym}}
            </a-form-item>
          </a-col>
          <a-col :lg="8" :md="12" :sm="24">
            <a-form-item label="考生档案所在单位">
              {{info.daszdw}}
            </a-form-item>
          </a-col>
          <a-col :lg="8" :md="12" :sm="24" :style="{width:info.daszdwdz && info.daszdwdz.length>20?'66%':''}">
            <a-form-item label="档案所在单位地址" >
              {{info.daszdwdz}}
            </a-form-item>
          </a-col>
          <a-col :lg="8" :md="12" :sm="24">
            <a-form-item label="本科毕业单位">
              {{info.bkbyxxmc}}
            </a-form-item>
          </a-col>
          <a-col :lg="8" :md="12" :sm="24">
            <a-form-item label="本科毕业专业">
              {{info.bkbyzy}}
            </a-form-item>
          </a-col>
          <a-col :lg="8" :md="12" :sm="24">
            <a-form-item label="获得本科证书形式">
              {{info.hbkzsxxxsm}}
            </a-form-item>
          </a-col>
          <a-col :lg="8" :md="12" :sm="24">
            <a-form-item label="本科毕业年月">
              {{info.bkbyny && info.bkbyny._i?info.bkbyny._i:''}}
            </a-form-item>
          </a-col>
          <a-col :lg="8" :md="12" :sm="24">
            <a-form-item label="本科毕业证书编号">
              {{info.bkbyzsbh}}
            </a-form-item>
          </a-col>
          <a-col :lg="8" :md="12" :sm="24">
            <a-form-item label="获学士学位单位">
              {{info.hxsxwdwmc}}
            </a-form-item>
          </a-col>
          <a-col :lg="8" :md="12" :sm="24">
            <a-form-item label="获学士学位专业">
              {{info.hxsxwzymc}}
            </a-form-item>
          </a-col>
          <a-col :lg="8" :md="12" :sm="24">
            <a-form-item label="获学士学位年月">
              {{info.hxsxwny && info.hxsxwny._i?info.hxsxwny._i:''}}
            </a-form-item>
          </a-col>
          <a-col :lg="8" :md="12" :sm="24">
            <a-form-item label="学士学位证书编号">
              {{info.xsxwzsbh}}
            </a-form-item>
          </a-col>
          <a-col :lg="8" :md="12" :sm="24">
            <a-form-item label="硕士毕业单位">
              {{info.ssbyxxmc}}
            </a-form-item>
          </a-col>
          <a-col :lg="8" :md="12" :sm="24">
            <a-form-item label="硕士毕业专业">
              {{info.ssbyzy}}
            </a-form-item>
          </a-col>
          <a-col :lg="8" :md="12" :sm="24">
            <a-form-item label="硕士毕业年月">
              {{info.ssbyny && info.ssbyny._i?info.ssbyny._i:''}}
            </a-form-item>
          </a-col>
          <a-col :lg="8" :md="12" :sm="24">
            <a-form-item label="硕士毕业证书编号">
              {{info.ssbyzsbh}}
            </a-form-item>
          </a-col>
          <a-col :lg="8" :md="12" :sm="24">
            <a-form-item label="获硕士学位单位">
              {{info.hssxwdwmc}}
            </a-form-item>
          </a-col>
          <a-col :lg="8" :md="12" :sm="24">
            <a-form-item label="获硕士学位专业">
              {{info.hssxwzymc}}
            </a-form-item>
          </a-col>
          <a-col :lg="8" :md="12" :sm="24">
            <a-form-item label="获硕士学位方式">
              {{info.hssxwfsm}}
            </a-form-item>
          </a-col>
          <a-col :lg="8" :md="12" :sm="24">
            <a-form-item label="获硕士学位年月">
              {{info.hssxwny && info.hssxwny._i?info.hssxwny._i:''}}
            </a-form-item>
          </a-col>
          <a-col :lg="8" :md="12" :sm="24">
            <a-form-item label="硕士学位证书编号">
              {{info.ssxwzsbh}}
            </a-form-item>
          </a-col>
          <a-col :lg="8" :md="12" :sm="24">
            <a-form-item label="最后学历">
              {{info.zhxlm}}
            </a-form-item>
          </a-col>
          <a-col :lg="8" :md="12" :sm="24">
            <a-form-item label="最后学位">
              {{info.zhxwm}}
            </a-form-item>
          </a-col>
          <a-col :lg="8" :md="12" :sm="24">
            <a-form-item label="注册学号">
              {{info.zcxh}}
            </a-form-item>
          </a-col>
          <a-col :lg="8" :md="12" :sm="24">
            <a-form-item label="报考类别">
              {{info.bklbm}}
            </a-form-item>
          </a-col>
          <a-col :lg="8" :md="12" :sm="24">
            <a-form-item label="考试方式">
              {{info.bsksfsm}}
            </a-form-item>
          </a-col>
          <a-col :lg="8" :md="12" :sm="24">
            <a-form-item label="录取后档案和工资关系">
              {{info.dasfzr}}
            </a-form-item>
          </a-col>
          <a-col :lg="8" :md="12" :sm="24">
            <a-form-item label="报考院系">
              {{info.bkyxsmc}}
            </a-form-item>
          </a-col>
          <a-col :lg="8" :md="12" :sm="24">
            <a-form-item label="报考专业">
              {{info.bkzymc}}
            </a-form-item>
          </a-col>
          <a-col :lg="8" :md="12" :sm="24">
            <a-form-item label="研究方向">
              {{info.bkyjfxmc}}
            </a-form-item>
          </a-col>
          <a-col :lg="8" :md="12" :sm="24">
            <a-form-item label="报考导师">
              {{info.bkdsyxm}}
            </a-form-item>
          </a-col>
          <a-col :lg="8" :md="12" :sm="24">
            <a-form-item label="外国语名称">
              {{info.wgymc}}
            </a-form-item>
          </a-col>
          <a-col :lg="8" :md="12" :sm="24">
            <a-form-item label="业务课一">
              {{info.ywkymc}}
            </a-form-item>
          </a-col>
          <a-col :lg="8" :md="12" :sm="24">
            <a-form-item label="业务课二">
              {{info.ywkemc}}
            </a-form-item>
          </a-col>
          <a-col :lg="8" :md="12" :sm="24">
            <a-form-item label="定向单位名称">
              {{info.dxwpdwmc}}
            </a-form-item>
          </a-col>
          <a-col :lg="8" :md="12" :sm="24">
            <a-form-item label="固定电话">
              {{info.gddh}}
            </a-form-item>
          </a-col>
          <a-col :lg="8" :md="12" :sm="24">
            <a-form-item label="移动电话">
              {{info.yddh}}
            </a-form-item>
          </a-col>
          <a-col :lg="8" :md="12" :sm="24">
            <a-form-item label="电子邮件">
              {{info.dzxx}}
            </a-form-item>
          </a-col>
          <a-col :lg="8" :md="12" :sm="24">
            <a-form-item label="通讯地址邮政编码">
              {{info.yzbm}}
            </a-form-item>
          </a-col>
          <a-col :lg="8" :md="12" :sm="24" :style="{width:info.txdz && info.txdz.length>20?'66%':''}">
            <a-form-item label="考生通讯地址">
              {{info.txdz}}
            </a-form-item>
          </a-col>

        </a-col>
        <a-col :md="6" :sm="24">
          <img style="display:block;width:100%" :src="info.zpdz"/>
        </a-col>
      </a-row>
    </a-form>
    <div class="drawer-bootom-button" style="z-index:1">
      <div style="float:right">
        <a-button type="primary" @click="handleCancel">关闭窗口</a-button>
      </div>
    </div>
  </a-drawer>
</template>

<script>
  import moment from 'moment'
  export default {
    props: {
      previewVisible: {
        default: false
      },
      info: {
        default: () => ({})
      }
    },
    data() {
      return {
        loading: false,
        postParams: {},
        imageUrl: '',
        selectMenu: {
          yx: [] // 院系
        },
        // 当前所在信息节点
        infoIdx: 0
      }
    },
    watch: {
      info() {
        if(this.info.zpdz){
        this.info.zpdz = process.env.IMG_URL + this.info.zpdz
        console.log(process.env.IMG_URL)
      }else{
        this.info.zpdz =require('../../../assets/icon_head_address.png')
      }
        if(this.info.gzgx=='01'){
          this.info.gzgx='否'
        }else{
          this.info.gzgx='是'
        }
        if(this.info.wgysfms=='0'){
          this.info.wgysfms='否'
        }else{
          this.info.wgysfms='是'
        }

        if(this.info.dasfzr=='01'){
          this.info.dasfzr='转入'
        }else{
          this.info.dasfzr='未转入'
        }
        if(this.info.sfwtdxl=='0'){
          this.info.sfwtdxl = '否'
        }else{
          this.info.sfwtdxl = '是'
        }
        if(this.info.bkbyny){
          this.info.bkbyny._i = moment(this.info.bkbyny._i).format('YYYY-MM')
        }
        if(this.info.hxsxwny){
          this.info.hxsxwny._i = moment(this.info.hxsxwny._i).format('YYYY-MM')
        }
         if(this.info.hssxwny){
          this.info.hssxwny._i = moment(this.info.hssxwny._i).format('YYYY-MM')
        }
        if(this.info.ssbyny){
          this.info.ssbyny._i = moment(this.info.ssbyny._i).format('YYYY-MM')
        }
        if(this.info.csrq){
          this.info.csrq._i= moment(this.info.csrq._i).format('YYYY-MM-DD')
        }
        if (document.getElementsByClassName('detailForm').length) {
          console.log((document.body.clientHeight - 120) + "px")
          document.getElementsByClassName('detailForm')[0].style.height = (document.body.clientHeight - 120) + "px"
        }
        if (document.getElementsByClassName('ant-form-item-label')) {
          for (var i = 0; i < document.getElementsByClassName('ant-form-item-label').length; i++) {
            document.getElementsByClassName('ant-form-item-label')[i].style.overflow = 'visible'

          }


        }
      }
    },
    methods: {
      // 关闭
      handleCancel() {
        this.$emit('close')
      }
    }
  }
</script>

<style lang="less" scoped="">
  .fullscreen {
    .ant-drawer-wrapper-body {
      height: 100%;
      overflow: auto;
    }
  }

  .ant-row.ant-form-item {
    display: flex;
    height: 63px;
    margin-bottom:10px;
    line-height: 21px;
  }
     @media (max-width: 575px){
   .ant-row.ant-form-item /deep/ .ant-form-item-label{

      white-space:inherit;
    }
     }

     @media (max-width: 575px){
   .ant-row.ant-form-item /deep/ .ant-form-item-control{
      line-height: 1.5
    }
     }
  .ant-row.ant-form-item>div:first-of-type {
    margin-right: 10px
  }

  .ant-col-sm-24.ant-col-md-6 {
    width: 260px;
    height: 260px
  }

</style>
